#include<bits/stdc++.h>
#define ll long long
#define L x<<1
#define R x<<1|1
#define mid (l+r>>1)
#define lc L,l,mid
#define rc R,mid+1,r
#define OK Ll<=l&&r<=Rr
#define Root 1,1,nx
#define rep(x,y,z) for(int x=(y);x<=(z);x++)
#define per(x,y,z) for(int x=(y);x>=(z);x--)
#define repn(x) rep(x,1,n)
#define repm(x) rep(x,1,m)
#define pb push_back
#define e(x) for(int i=h[x],y=to[i];i;i=nxt[i],y=to[i])
#define E(x) for(auto y:p[x])
#define Pi pair<int,int>
#define ui unsigned ll
inline int read(){int s=0,w=1;char c=getchar();while(c<48||c>57) {if(c=='-') w=-1;c=getchar();}while(c>=48&&c<=57)s=(s<<1)+(s<<3)+c-48,c=getchar();return s*w;}
inline void pf(int x){if(x<0) putchar('-'),x=-x;if(x>9)pf(x/10);putchar(x%10+48);}
using namespace std;
const int N=2e5+5,M=7e6+5,inf=(1LL<<31)-1,mod=998244353;
const ll llf=1e18;
inline void add(int &a,int b){((a+=b)>=mod) and (a-=mod);}
inline int Add(int a,int b){return add(a,b),a;}
inline int mul(int a,int b){return 1LL*a*b%mod;}
inline void Mul(int &a,int b){a=mul(a,b);}
inline void red(int &a,int b){add(a,mod-b);}
inline int Red(int a,int b){return red(a,b),a;}
inline int qp(int a,int b){if(!b)return 1;int c=qp(a,b>>1);Mul(c,c);if(b&1)Mul(c,a);return c;}
inline int INV(int x){return qp(x,mod-2);}
int testid,n,m,lshx[N],lshy[N],bx[N],by[N],nx,ny;
struct node{
	int x,y,X,Y;
}a[N];
inline void solx(int &x){
	x=lower_bound(bx+1,bx+nx+1,x)-bx;
}
inline void soly(int &x){
	x=lower_bound(by+1,by+ny+1,x)-by;
}
struct seg{
	int len,t;
}xd[N<<3];
inline void build(int x,int l,int r){
	xd[x]={0,0};
	if(l==r)return;
	build(lc),build(rc);
}
inline void getup(int x,int l,int r){
	if(xd[x].t)xd[x].len=bx[r+1]-bx[l];
	else xd[x].len=xd[L].len+xd[R].len;
}
inline void modify(int x,int l,int r,int Ll,int Rr,int k){
	if(OK)return xd[x].t+=k,getup(x,l,r),void();
	if(Ll<=mid)modify(lc,Ll,Rr,k);
	if(Rr>mid)modify(rc,Ll,Rr,k);
	getup(x,l,r);
}
struct nod{
	int l,r,k;
};
vector<nod>p[N];
inline void subtask1(){
	//直接暴力扫描线
	ny++;
	repn(i)a[i].Y++;
	while(m--){
		int l=read(),r=read();
		rep(i,1,ny)p[i].clear();
		rep(i,l,r){
			p[a[i].y].pb({a[i].x,a[i].X,1});
			p[a[i].Y].pb({a[i].x,a[i].X,-1});
		}	
		ll ans=0;
		build(Root);
		rep(i,1,ny){
			ans+=1LL*(by[i]-by[i-1])*xd[1].len;
			E(i)modify(Root,y.l,y.r,y.k);
		}
		cout <<ans<<'\n';
	}
}
inline void Main(){
	testid=read(),n=read(),m=read();
	repn(i)lshx[i*2-1]=a[i].x=read(),lshy[i*2-1]=a[i].y=read(),lshx[i<<1]=a[i].X=read(),lshy[i<<1]=a[i].Y=read();
	sort(lshx+1,lshx+n*2+1),sort(lshy+1,lshy+n*2+1);
	rep(i,1,n<<1){
		if(lshx[i]^lshx[i+1])bx[++nx]=lshx[i];
		if(lshy[i]^lshy[i+1])by[++ny]=lshy[i];
	}
	repn(i)solx(a[i].x),solx(a[i].X),soly(a[i].y),soly(a[i].Y),a[i].X--,a[i].Y--;
	nx--,ny--;
	subtask1();
}
signed main(){
	freopen("dierti.in","r",stdin);
	freopen("dierti.out","w",stdout);
	int T=1;
	while(T--)Main();
	return 0;
}	
